package my.test.flyweight.source;

/**
 * @Author 许玉康
 * @Date 2019-11-4 12:23
 * 抽象享元对象
 */
public abstract class Flyweight {

    //内部状态
    private String intrinsic;
    //外部状态
    protected final String extrinsic;

    //要求享元模式必须接受外部状态
    public Flyweight(String extrinsic) {
        this.extrinsic = extrinsic;
    }

    //定义业务操作
    public abstract void operate();

    public String getIntrinsic() {
        return intrinsic;
    }

    public void setIntrinsic(String intrinsic) {
        this.intrinsic = intrinsic;
    }
}
